import { createRouter, createWebHashHistory } from 'vue-router'
const Recommend = () => import('@/views/recommend/recommend.vue')
const Search = () => import('@/views/search/search.vue')
const Singer = () => import('@/views/singer/singer.vue')
const Toplist = () => import('@/views/toplist/toplist.vue')
const SingerDetail = () => import('@/views/singer/singerdetail')
const Albums = () => import('@/views/recommend/albums.vue')
const Toplistdetail = () => import('@/views/toplist/toplistdetail.vue')

const routes = [
  {
    path: '/',
    redirect: '/recommend'
  },
  {
    path: '/recommend',
    component: Recommend,
    children: [
      {
        path: '/recommend/:id',
        component: Albums
      }
    ]
  },
  {
    path: '/singer',
    component: Singer,
    children: [
      {
        path: ':id',
        component: SingerDetail
      }
    ]
  },
  {
    path: '/search',
    component: Search,
    children: [
      {
        path: ':id',
        component: SingerDetail
      }
    ]
  },
  {
    path: '/top-list',
    component: Toplist,
    children: [
      {
        path: ':id',
        component: Toplistdetail
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
